﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using ajayumi.develop.win32.Transport.WCF.Services.Interfaces;
using ajayumi.develop.win32.Transport.WCF.Services.DataContracts;

namespace ajayumi.develop.win32.Transport.AppUpgrade
{
    /// <summary>
    /// 程序升级服务客户端
    /// Author   : 黄乙冬
    /// Date     : 2011-09-02
    /// </summary>
    public class UpgradeServiceClient : ClientBase<IUpgrade>, IUpgrade, IDisposable
    {

        public UpgradeServiceClient()
            : base("Upgrade")
        {

        }

        #region IUpgrade


        public CheckUpgradeVerInfo CheckVersion(string appName, string version)
        {
            return base.Channel.CheckVersion(appName, version);
        }

        public UpgradeInfo GetUpgrade(string appName, string version)
        {
            return base.Channel.GetUpgrade(appName, version);
        }

        #endregion

        #region IDisposable

        void IDisposable.Dispose()
        {
            if (this.State == CommunicationState.Opened)
            { this.Close(); }
        }

        #endregion






    }
}
